package cn.com.leon.controller.action;

import java.util.List;

import cn.com.leon.controller.BaseAction;
import cn.com.leon.model.GradeClass;
import cn.com.leon.model.Student;

public class GradeClassAction extends BaseAction<GradeClass>{

	public GradeClassAction(){
		super("classes");
	}
	
	
	@Override
	public boolean del(GradeClass entity) {
		super.del(entity);
		StudentAction tmpAction = new StudentAction();
		List<Student> list = tmpAction.list();
		for (Student student : list) {
			if(student.getGradeClass().equals(entity))
				tmpAction.del(student);
		}
		return true;
	}


	/**
	 * 
	 */
	private static final long serialVersionUID = 6599552764030729110L;

}
